<html>
<head><meta charset="utf-8"><title>Wrong indexing in vscode · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html">Wrong indexing in vscode</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="237856510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237856510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237856510">(May 07 2021 at 17:02)</a>:</h4>
<p>In my environment, with latest vscode and RA. I have two window with RA and test project open. For test project also the indexing is performed for all 600+ crates.</p>



<a name="237856743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237856743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237856743">(May 07 2021 at 17:03)</a>:</h4>
<p>I know that RA uses those many crates but in test project there is only single crate dependency which may have not more than 50 transient dependencies.</p>



<a name="237856868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237856868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237856868">(May 07 2021 at 17:04)</a>:</h4>
<p>is the test project in a cargo workspace that contains more crates?</p>



<a name="237856908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237856908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237856908">(May 07 2021 at 17:04)</a>:</h4>
<p>I have below questions:</p>
<ol>
<li>Who have responsibility of indexing? vscode or RA</li>
<li>Why it reindex all crates from 1st RA project.</li>
</ol>



<a name="237857007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857007">(May 07 2021 at 17:05)</a>:</h4>
<p>no. the test project is single project to test RA debug.</p>



<a name="237857113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857113">(May 07 2021 at 17:06)</a>:</h4>
<p>it does not have any code besides main function and single crate import statement.</p>



<a name="237857633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857633">(May 07 2021 at 17:09)</a>:</h4>
<p>RA indexes dependencies</p>



<a name="237857687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857687">(May 07 2021 at 17:09)</a>:</h4>
<p>can you push the code somewhere so we can try to reproduce?</p>



<a name="237857832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857832">(May 07 2021 at 17:10)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">use</span><span class="w"> </span><span class="n">s3</span>::<span class="n">bucket</span><span class="p">;</span><span class="w"></span>
<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="237857866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857866">(May 07 2021 at 17:10)</a>:</h4>
<p>this is the only code in <a href="http://main.rs">main.rs</a></p>



<a name="237857906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857906">(May 07 2021 at 17:11)</a>:</h4>
<p>cargo.toml has this single dependency rust-s3 = "0.26.4"</p>



<a name="237857985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237857985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237857985">(May 07 2021 at 17:11)</a>:</h4>
<p>this is happening with weekly release and latest master code also.</p>



<a name="237858394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237858394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237858394">(May 07 2021 at 17:14)</a>:</h4>
<p>I tested with single test project open also, then also it is indexing 600+ crates.</p>



<a name="237858763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237858763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237858763">(May 07 2021 at 17:16)</a>:</h4>
<p>rust-s3 has ~350 transitive dependencies</p>



<a name="237858766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237858766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237858766">(May 07 2021 at 17:16)</a>:</h4>
<p>I recently updated rust toolchain to 1.52.0.</p>



<a name="237859159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237859159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237859159">(May 07 2021 at 17:18)</a>:</h4>
<p>On my machine RA indexes 764 crates.</p>



<a name="237859287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237859287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237859287">(May 07 2021 at 17:19)</a>:</h4>
<p>yeah, I can reproduce that</p>



<a name="237859368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237859368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237859368">(May 07 2021 at 17:20)</a>:</h4>
<p>but it's not a &gt;10x increase, just ~2x or so</p>



<a name="237859518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237859518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237859518">(May 07 2021 at 17:21)</a>:</h4>
<p>if you want to look into this, I think the next step would be to add some debug logging to print out what exactly all these crates are</p>



<a name="237859780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237859780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237859780">(May 07 2021 at 17:22)</a>:</h4>
<p>How did you get all transitive dependencies for rust-s3 crate?</p>



<a name="237859871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237859871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237859871">(May 07 2021 at 17:23)</a>:</h4>
<p>will need that to verify indexing crates list.</p>



<a name="237860047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237860047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237860047">(May 07 2021 at 17:24)</a>:</h4>
<p><code>cargo tree</code></p>



<a name="237860070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wrong%20indexing%20in%20vscode/near/237860070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wrong.20indexing.20in.20vscode.html#237860070">(May 07 2021 at 17:24)</a>:</h4>
<p>BTW RA indexes 627 crates.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>